<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
	<title><spring:message code="YYK-title-10004" /></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=0.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
	<meta name=”apple-mobile-web-app-capable” content=”yes” />
	<script type="text/javascript">
	;(function (doc, win) {
	    var docEl = doc.documentElement,
	      resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
	      recalc = function () {
	        var clientWidth = docEl.clientWidth;
	        var clientHeight = docEl.clientHeight;
	        if (!clientWidth) return;
	        if (clientWidth < clientHeight) {
	            docEl.style.fontSize = 100 * (clientWidth / 640) + 'px';
	        }else{
	          docEl.style.fontSize = 50 * (clientWidth / 1136) + 'px';
	        }
	      };
	      recalc();
	    if (!doc.addEventListener) return;
	    win.addEventListener(resizeEvt, recalc, false);
	    doc.addEventListener('DOMContentLoaded', recalc, false);   
	})(document, window);
	</script>
	<link rel="stylesheet" type="text/css" href="${static_server}/static/css/default.css">
	<link rel="stylesheet" href="${server}/static/css/iconfont/iconfont.css">
	<link rel="stylesheet" href="${static_server}/static/css/common/zepto.alert.css">
	
	<script type="text/javascript" src="${static_server}/static/js/common/base.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/zepto.min.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/settlement/settlement.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/common.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/common/common.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/common/common.ajax.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/iscroll.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/settleAccounts.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/common/zepto.alert.js"></script>
</head>
<body>
<div class="wrap">
	<header class="headerToFixed">
		<div class="closeBtn" onclick="javascript:goBack();">
			   <i class="icon iconfont">&#xe60a;</i>
			</div>
		<div class="headerTitle">
			<spring:message code="YYK-title-10004" />
		</div>
	</header>
	
	<div class="contentWrap">
		<!-- <div class="height:0.9rem;width:100%"></div> -->
		<div id="defaultAddress" class="addressComponent commonSubHeader" onclick="javascript:chooseAddress();">
				<c:if test="${empty settlementDTO.recepient}">
					添加收货地址
				</c:if>
				<c:if test="${not empty settlementDTO.recepient}">
				<div class="addressDetailBox">
						<div>
							<spring:message code="YYK-20034" />: 
							<span class="name" style="font-weight: bold;"id="recepientName">
							${settlementDTO.recepient.recepientName}
						</span>
						<spring:message code="YYK-20035" />:
						<span class="tel"style="font-weight: bold;padding-left:0.3rem"> ${settlementDTO.recepient.recepientTel}</span>
						</div>
						<div style="margin-top: 0.05rem !important;">
						<span class="addressDetail">
							${settlementDTO.recepient.recepientProvinceName}
							${settlementDTO.recepient.recepientCityName}
							${settlementDTO.recepient.recepientAreaName}
							${settlementDTO.recepient.recepientAddress}
						</span>
						<span class="emailNum">${settlementDTO.recepient.recepientPostCode}</span>
						</div>
				</div>
				</c:if>
			<div class="editAddress fr">
				<i class="icon iconfont">&#xe606;</i>
			</div>
		</div>
		<div id="defaultIDCard" style="height: 0.9rem;padding: 0.3rem 0.17rem 0.37rem 0.19rem;font-size: 0.26rem;box-sizing: border-box;    background: #fff;border-bottom: 1px solid #cfcfcf;border-top: 1px solid #cfcfcf;" 
			onclick="javascript:findIDCard();"class="mts15">
				<c:if test="${empty settlementDTO.idCard}">
					添加身份证信息，必须和收件人姓名一致
				</c:if>
				<c:if test="${not empty settlementDTO.idCard}">
				<div style="display: inline-block;width: 83%;">
					<p>
						<span style="padding-right:0.4rem;" id="identityCardName">
							${settlementDTO.idCard.identityCardName}
						</span>
						<span>${settlementDTO.idCard.identityCardNumber}</span>
					</p>
				</div>
				</c:if>
			<div style="font-size: 1.12em !important;color: #d9d9d9;float: right;">
				<i class="icon iconfont">&#xe606;</i>
			</div>
		</div>
		
		<div class="clear:both;"></div>
		<div class="srcollBox">
			<div id="wrapper">
				<div id="scroller">
				<ul class="box-item-detail">
					<li>
						<div class="HWrapperBox">
							<div id="Hwrapper0" class="Hwrapper">
								<div id="Hscroller0" class="Hscroller"
									style="width: 536px; transition-timing-function: cubic-bezier(0.1, 0.57, 0.1, 1); transition-duration: 0ms; transform: translate(0px, 0px) translateZ(0px);">
									<ul>
										<c:forEach items="${settlementDTO.cartDTO.cartSkuDTOList}"
											var="cartSkuDTO">
											<li>
												<div class="settleImg">
													<img
														src="${static_server}${cartSkuDTO.merchandise.merchandiseIcon}">
												</div>
												<div class="settleQuanlity">
													x<span>${cartSkuDTO.qty}</span>
												</div>
											</li>
										</c:forEach>
									</ul>
								</div>
							</div>
							<div class="totalQuanBox fr">
								<div style="display:inline-block"><span id="J_totalQuan">${settlementDTO.cartDTO.totalNumber}</span>件</div>
								<div class="moreBtn">
								
									<i class="icon iconfont"></i>
								</div>
							</div>
						</div>
					</li>
				</ul>
			<div class="paymentBox mts15">
			<p class="paymentTitle">
				<spring:message code="YYK-20014" />
			</p>
			<div class="paymentWay">
				<%-- <div class="wxBox">
					<div class="check-box">
						<input type="radio" name="payment" />
					</div>
					<div class="wx">
						<img src="${static_server}/static/images/btn/weixin.png" alt="">
					</div>
				</div> --%>
				<%-- 支付宝 --%>
				<%-- <div class="zfbBox">
					<div class="check-box">
						<input type="radio" name="payment" class="payment" value="1"
						<c:if test="${settlementDTO.payment.paymentType eq 1}">
							checked="checked"
						</c:if>
						/>
					</div>
					<div class="zfb">
						<img src="${static_server}/static/images/btn/zfb.png" alt="">
					</div>
				</div> --%>
				<!-- <div class="cardBox">
					<div class="check-box">
						<input type="radio" name="payment" />
					</div>
					<div class="card">
						<img src="img/btn/card.png" alt="">
					</div>
				</div> -->
				<!-- <div class="cashBox">
					<div class="check-box">
						<input type="radio" name="payment" />
					</div>
					<div class="cash">
						<img src="img/btn/cash.png" alt="">
					</div>
				</div> -->
				<%-- 收银台 --%>
				<div class="cashBox">
					<div class="check-box">
						<input type="radio" name="payment" class="payment" value="2"
						<c:if test="${settlementDTO.payment.paymentType eq 2}">
							checked="checked"
						</c:if>
						/>
					</div>
					<div class="cashText">
					<spring:message code="YYK-20028" />
					</div>
					<div class="cash" style="opacity:0">
						<img src="${static_server}/static/images/btn/cash.png" alt="">
					</div>
				</div>
			</div>
		</div>
			<div class="mts15 acountTipsBox">
				<ul class="coupon">
					<li class="cash-coupon">
							<spring:message code="YYK-20016" />
							<div class="moreBtn fr" id="cash-coupon">
								<span id="tranCouponNum">0</span><spring:message code="YYK-20015" />&nbsp;<i class="icon iconfont">&#xe603;</i>
							</div>
					<li class="logistics-coupon">
						<spring:message code="YYK-20017" />
							<div class="moreBtn fr" id="logistics-coupon">
								<span id="tranCouponNum">0</span><spring:message code="YYK-20015" />&nbsp;<i class="icon iconfont">&#xe603;</i>
							</div>
					</li>
				</ul>
			</div>

		</div>
		</div>
		</div>			
	</div>
	<footer class="footerToFixed">
		<div class="moneyBox">
				<p class="productAccount">
					<spring:message code="YYK-20006" />
					<span class="redFont">€
						<fmt:formatNumber value="${settlementDTO.cartDTO.itemAmount}" pattern="#0.00"/>
					</span>
					<c:forEach items="${settlementDTO.couponList}" var="coupon">
						<%-- 现金券 --%>
						<c:if test="${coupon.couponType eq 0}">
							减<span class="redFont">€${coupon.couponAmount}</span>
						</c:if>
					</c:forEach>
				
				</p>
				
				<label class="carriage"><spring:message code="YYK-20020" />
				<span>
					<c:if test="${settlementDTO.cartDTO.totalFreight==0}">
						<spring:message code="YYK-20055" />
					</c:if> <c:if test="${settlementDTO.cartDTO.totalFreight!=0}">
						<fmt:formatNumber value="${settlementDTO.cartDTO.totalFreight}" pattern="€0.00#" />
					</c:if> 
				</span></label>
				<c:forEach items="${settlementDTO.couponList}" var="coupon">
					<%-- 物流券 --%>
					<c:if test="${coupon.couponType eq 1}">
						<label class="cutCarriage">减<span>€${coupon.couponAmount}</span></label>
					</c:if>
				</c:forEach>
		</div>
		<div class="footerMenu mts15">
			<ul>
				<li ><spring:message code="YYK-20022" /><span>
				<fmt:formatNumber value="${settlementDTO.cartDTO.payAmount}" pattern="€0.00#" />
				</span></li>
				<li class="selectedBg submit-btn" onclick="javascript:submitOrder();"><spring:message code="YYK-20023" /></li>
			</ul>
		</div>
	</footer>
</div>
<input type="hidden" id="path" value="${server}"/>
<input type="hidden" id="shopId" value="${settlementDTO.cartDTO.shop.shopId}"/>
</body>
</html>	